const mongoose = require("mongoose");


const works = mongoose.Schema({
  // 发布用户id
  user_id: {
    type: mongoose.SchemaTypes.ObjectId,
    required: true,
    ref: 'user',
  },
  // 标题
  title: {
    type: String,
    required: true
  },
  // 分类
  classList: {
    type: String,
    required: true
  },
  // 发布时间
  pushTime: {
    type: String,
    required: true
  },
  // 图片
  img: {
    type: Array,
    required: true
  }
});

module.exports = mongoose.model("works", works);


